<template>
  <div class="hello">
    {{msg}}
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  created() {
    this.getData()
  },
  data () {
    return {
      msg: ''
    }
  },
  methods:{
    getData(){
      this.$http.get('/api/msg')
        .then(res => {
          this.msg = res.data;
        })
        .catch(error=> {
          this.msg = error.toString();
          console.log(error.toString());
        });

    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
